package com.shop.front.dao.user;


import com.shop.jpa.BaseSQLDao;
import com.shop.jpa.support.QuerySQL;
import com.shop.domain.user.UserIntegralBill;
import com.shop.web.context.WebContext;
import org.springframework.data.domain.Page;
import org.springframework.stereotype.Repository;

@Repository
public class UserIntegralBillSQLDao extends BaseSQLDao {

    /**
     * 分页查询推荐用户列表
     *
     * @param userId
     * @return
     */
    public Page<UserIntegralBill> pageIntegralBill(Long userId) {
        StringBuffer field = new StringBuffer("u.*");
        String from = "t_user_integral_bill u";
        String order = "u.id desc";
        QuerySQL qs = new QuerySQL(WebContext.getPageNo(), WebContext.getPageSize(), field.toString(), from, order);
        qs.addWhereWithoutParams("u.is_deleted = 0 ");
        qs.addWhereEq("u.uid", userId);
        return this.page(qs, UserIntegralBill.class);
    }



}
